<template>
	<view class="container">
		<view v-html="src" v-if="show"></view>
		<view class="BOX" v-else>
			<image src="../../static/bg.png" mode="" class="loading"></image>
			<view class="TitleBox">
				<view class="name">查询项目: {{type ==1 ? '车辆历史报告-事故型' : '车辆历史报告-维保型'}}</view>
				<view class="vin">车辆VIN码: {{vin}}</view>
				<view class="time">查询时间: {{time}}</view>
			</view>
			<view class="searchText">查询中</view>
		</view>
	</view>
</template>

<script>
import { QueryPastResults } from '../../API/api';
	export default {
		data() {
			return {
				src:'',
				show:false,
				orderId:null,
				type:0,
				time:'',
				vin:''
				
			};
		},
		onLoad(options) {
			this.orderId = options.orderId
			this.type = options.type
			this.time = options.TIME
			this.vin = options.vin
			this.getItem()
		},
		methods:{
			getItem(){
				QueryPastResults(this.orderId).then(res=>{
					this.src = res.data
					if(this.src.indexOf('报告生成中')>=0){
						this.show = false
					}else{
						this.show =true
					}
				}).catch(err=>{})
			}
		}
	}
</script>

<style lang="scss" scoped>
.container{
	.BOX{
		height: 998rpx;
		position: relative;
		.loading{
			width: 100%;
			height: 998rpx;
			display: block;
		}
		.searchText{
			top: 90rpx;
			left: 50%;
			color: #FFF;
			font-size: 40rpx;
			font-weight: bold;
			position: absolute;
			transform: translate(-50%,0);
		}
		.TitleBox{
			left: 50%;
			bottom: 204rpx;
			position: absolute;
			transform: translate(-50%,0);
			.name{
				color: #FFFFFF;
				font-weight: 400;
				font-size: 30rpx;
				white-space: nowrap;
				text-align: center;
				margin-bottom: 30rpx;
			}
			.vin{
				color: #FFFFFF;
				font-weight: 400;
				font-size: 30rpx;
				white-space: nowrap;
				text-align: center;
				margin-bottom: 40rpx;
			}
			.time{
				font-weight: 400;
				font-size: 26rpx;
				white-space: nowrap;
				text-align: center;
				color: rgba(255,255,255,0.7);
			}
		}
	}
}
</style>
